// 引入路由
import Vue from "vue";
import VueRouter from "vue-router";

const One = () => import('../components/One.vue')
const Two = () => import('../components/Two.vue')

// 把路由作为插件使用
Vue.use(VueRouter)

// 实例化路由得到路由对象
export default new VueRouter({
    // 设置路由模式为history
    mode: 'history',
    //使用routes配置路由表
    routes: [
        {
            path: '/one',
            component: One
        },
        {
            path: '/two',
            component: Two
        }
    ]
})